<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AlertSizeToFileTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('files', function (Blueprint $table) {
            $table->integer('size')->after('source')->nullable()->comment('文件大小,单位字节(b)');
            $table->string('type')->after('size')->nullable()->comment('文件类型');
            $table->integer('star')->after('type')->default(0)->comment('收藏数');
            $table->integer('download')->after('star')->default(0)->comment('下载次数');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
